#ifndef _LOADINGSCENE_H_
#define _LOADINGSCENE_H_

#include "cocos2d.h"
#include "Box2D/Box2D.h"

/**
 * This scene/layer loads resources and indicates the process using a progress bar.
 */
class LoadingScene :
	public cocos2d::CCLayer
{
public:
	LoadingScene();
	bool init();
	void onEnter();
	static cocos2d::CCScene* scene();

	CREATE_FUNC(LoadingScene);

private:
	cocos2d::CCSize 		  	__winSize;
	cocos2d::CCProgressTimer* 	__pProgressBar;
	cocos2d::CCLabelTTF* 		__loadingLabel;
	float						__numberOfLoadedResources;
	float						__numberOfResources;

	void updateProgress(float progress);
	void loadMainScene();
	void resourceLoadedCallback(cocos2d::CCObject* obj = NULL);
	void updateLoadingLabel(float dt);
	void preloadSoundFile(cocos2d::CCObject* fileName, bool musicFile = false);
};

#endif //_LOADINGSCENE_H_
